/**
* Class representing an extension point for a declared interface
*/
jsx3.lang.Class.defineClass("tibco.admin.util.component.ExtensionPoint",
        jsx3.lang.Object,
        null,
        function(config) {

            /**
            * The id of the extension point
            * @private
            */
            config.prototype.id = null;

            /**
            * The user-readable description of the extension point and it's purpose
            */
            config.prototype.description = null;

            /**
            * Contsructor for this class
            *
            * @param doc {jsx3.xml.Entity} xml node containing the extension point information
            * @throws {tibco.admin.exception.InvalidComponentSchemaException} if the xml is invalid
            */
            config.prototype.init = function(doc) {
                this.jsxsuper();
                var children = doc.getChildNodes().iterator();
                while(children.hasNext()) {
                    var child = children.next();
                    var childName = child.getNodeName();
                    if(childName == "extension_point_id") {
                        this.id = child.getValue();
                    }
                    else if(childName == "description") {
                        this.description = child.getValue();
                    }
                    else {
                        throw new tibco.admin.exception.InvalidComponentSchemaException("Unknown tag '" + childName + "' in the 'extension_point' tag of the component schema.  Supported tags are: extension_point_id, description");
                    }
                }
                if(!this.id) {
                    throw new tibco.admin.exception.InvalidComponentSchemaException("Tag 'extension_point_id' is a required child of 'extension_point' tag.")
                }
                if(jsx3.util.strTrim(this.id.trim()) == "") {
                    throw new tibco.admin.exception.InvalidComponentSchemaException("Tag 'extension_point_id' may not be empty.")
                }
                if(!this.description) {
                    throw new tibco.admin.exception.InvalidComponentSchemaException("Tag 'description' is a required child of 'extension_point' tag.")
                }
                if(jsx3.util.strTrim(this.description.trim()) == "") {
                    throw new tibco.admin.exception.InvalidComponentSchemaException("Tag 'description' may not be empty.")
                }
            }

            /**
            * Gets the id of the extension point
            *
            * @return {String} the id of the extension point
            */
            config.prototype.getId = function() {
                return this.id;
            }

            /**
            * Gets the user-readable description of the extension point
            *
            * @return {String} the extension points description
            */
            config.prototype.getDescription = function() {
                return this.description;
            }

            /**
             * Returns a string representing this object in the xml format specified by the component.xsd schema
             *
             * @param prepend {String} a string to be prepended to each line of the returned XML (useful for indenting)
             *
             * @returns {String} this ComponentConfig as XML, as specified by the component.xsd schema
             */
            config.prototype.toString = function(prepend) {
                if(!prepend) {
                    prepend = "";
                }
                var ret = prepend + "<extension_point>\n";
                if(this.id) {
                    ret += prepend + "   <extension_point_id>" + this.id + "</extension_point_id>\n";
                }
                if(this.description) {
                    ret += prepend + "   <description>" + this.description + "</description>\n";
                }
                ret += prepend + "</extension_point>\n";
                return ret;
            }
        }
);